package javaio12.inputreaderdemo;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;

public class OutputStreamDemo01
{

	/**
	 * @throws IOException 
	 * @param args
	 * @throws  
	 */
	public static void main(String[] args) throws IOException 
	{
		// TODO Auto-generated method stub
		File f = new File("E:"+File.separator+"study2012"+File.separator+"4IOTest.txt");
		Reader in = null;
		try
		{
			in =new InputStreamReader(new FileInputStream(f));
		}
		catch(FileNotFoundException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try
		{
			char [] temp = new char[(int)f.length()];
			in.read(temp);
			System.out.print(temp);
		}
		catch(IOException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		in.close();
	}

}
